package net.sf.odinms.server.maps;

import net.sf.odinms.client.IItem;
import net.sf.odinms.client.MapleCharacter;
import net.sf.odinms.client.MapleInventoryType;

/**
 *
 * @author Patrick/PurpleMadness
 */
public class FakeCharacter {
    private MapleCharacter ch;
    
    public FakeCharacter(String name, MapleCharacter player, int id)
    {
        MapleCharacter fake = new MapleCharacter();
        fake.setHair(player.getHair());
        fake.setFace(player.getFace());
        fake.setSkinColor(player.getSkinColor());
        fake.setName(name);
        fake.setID(id + 100000);
        fake.setLevel(player.getLevel());
        fake.setJob(player.getJob().getId());
        fake.setMap(player.getMap());
        fake.setPosition(player.getPosition());
        fake.silentGiveBuffs(player.getAllBuffs());
        
        for(IItem equip : player.getInventory(MapleInventoryType.EQUIPPED)){
            fake.getInventory(MapleInventoryType.EQUIPPED).addFromDB(equip);
        }
        
        fake.isfake = true;
        
        player.getMap().addBotPlayer(fake);
        
        ch = fake;
    }
    
    public MapleCharacter getFakeChar()
    {
        return ch;
    }
}
